import proFetch from '../../../../hrpub/common/utils/project-fetch';


export default {
    name : 'main',
    data : {
        treeData : [], //左树数据
        pageInfo : {
            pageIndex: 1,
            pageSize: 10,
            total: 0,
            totalPage: 1
        },
        json: {},
        pk_itemtype: '', //左树主键
        selectedKeys: ["0-0"],
        operation: 'browse', //操作页面状态 'add'为新增 'edit'为编辑 'browse'为浏览
        modaltitle: '' //弹窗标题
    },
    sync : {
        update(state, payload) {
            return {
                ...state,
                ...payload
            };
        }
    },
    async : {
        /**
         * 查询左树数据
         * @param {*} dispatch 
         * @param {*} getstate 
         * @param {*} data 
         */
        getTreeData(dispatch,getstate,data){
            return proFetch({
                url: '/nccloud/hrtrn/handitem/HandItemTypeTreeQueryAction.do',
                body: data
            })

        },
        /**
         *查询右表数据
         * @param {*} dispatch 
         * @param {*} getstate 
         * @param {*} data 
         */
        getTableData(dispatch,getstate,data){
            return proFetch({
                url: '/nccloud/hrtrn/handitem/HandItemsQueryAction.do',
                body: data
            })
        },

        /**
         * 删除右表数据
         * @param {*} dispatch 
         * @param {*} getstet 
         * @param {*} data 
         */
        delTableData(dispatch,getstet,data){
            return proFetch({
                url: '/nccloud/hrtrn/handitem/HandItemDelAction.do',
                body: data
            })
        }

    }


}